package com.rimac.wsbpm.personas.ejb.facade.proxy;

import java.rmi.RemoteException;

import javax.naming.InitialContext;
import javax.naming.NamingException;
import javax.xml.rpc.ServiceException;

import pe.com.rimac.portal.common.ws.AbstractPortProxy;

import com.rimac.wsbpm.personas.ejb.facade.PersonaFacade;
import com.rimac.wsbpm.personas.ejb.facade.PersonaFacadeService;
import com.rimac.wsbpm.personas.ejb.facade.PersonaFacadeServiceLocator;

public class PersonaFacadeProxy extends AbstractPortProxy implements PersonaFacade
{
	@Override
	public String buscarPersona(String xmlParam) throws RemoteException
	{
		return ((PersonaFacade) getPort()).buscarPersona(xmlParam);
	}

	@Override
	public String buscarPersonaAcx(String xmlParam) throws RemoteException
	{
		return ((PersonaFacade) getPort()).buscarPersonaAcx(xmlParam);
	}
	
	@Override
	protected Object lookupJndi(InitialContext ctx) throws NamingException, ServiceException
	{
		return ((PersonaFacadeService) ctx.lookup("java:comp/env/service/PersonaFacadeService")).getPersonaFacade();
	}
	
	@Override
	protected Object lookupLocator() throws ServiceException
	{
		return new PersonaFacadeServiceLocator().getPersonaFacade();
	}
}